//
//  AccountObjects.swift
//  SecretChat
//
//  Created by TimTiger on 16/6/21.
//  Copyright © 2016年 TimTiger. All rights reserved.
//

import UIKit

public enum SCUserRelationship: NSInteger {
    case stranger = 0
    case friend = 1
    case special = 2

    static func relationshipWithRawValue(value: Int)->SCUserRelationship {
        let relationship = SCUserRelationship(rawValue: value)
        if relationship == nil {
            return SCUserRelationship.stranger
        }
        return relationship!
    }
    
}

/// 用户信息
public class SCUserInfo: SCBaseObject {
    /// ID
    public lazy var userID: String = ""
    /// 昵称
    public lazy var nickname: String = ""
    /// 头像地址
    public lazy var avatar: String = ""
    /// 推送Token
    public lazy var pushToken: String = ""
     /// 与我的关系，默认是陌生人
    public lazy var relationship: SCUserRelationship = SCUserRelationship.stranger
    
    public func update() {
        SCDBUser.updateUserInfo(self)
    }
}
